<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
global $data, $admin;

class Xpanel extends CI_Controller {

    public function __construct() {
        parent::__construct();
        global $admin, $data;
        # cargamos variables
        $admin = $this->session->userdata('admin');
        $admin['place'] = 'xpanel';
        # verifica si pasó por sushitto
        if ($admin['tu_tipo_usuario'] != 1) {
            redirect('welcome');
        }
        $this->output->enable_profiler(TRUE);
    }

    public function index() {
        $this->load->view('template/header');
        $this->load->view('administrador/xpanel/sidebar');
        $this->load->view('administrador/xpanel/content');
        $this->load->view('template/footer');
    }

    public function logOut() {
        # termina session de ususario
        $this->session->sess_destroy();
        redirect(base_url());
    }

}
